package wang.yangziqing.app_kotlin.base

import android.app.Application
import com.lzy.okgo.OkGo
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit

/**
 * Created by Administrator on 2017/12/6.
 */
open class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        //初始化okgo 使用默认的最简单的方法配置okgo
        OkGo.getInstance().init(this)
//使用okhttp配置
//initOkgo()

    }

//    private fun initOkgo() {
//        val builder = OkHttpClient.Builder()
////读取超时时间
//        builder.readTimeout(2000,TimeUnit.MILLISECONDS)
//                //......
//       OkGo.getInstance().init(this)
//               .setOkHttpClient(builder.build())
//               .setCacheMode(0)
//               .setRetryCount(3)
//               .addCommonParams()
//    }


}